package com.dbz.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dbz.dao.SupplierDao;
import com.dbz.entity.Supplier;
import com.dbz.service.SupplierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

@Service
public class SupplierServiceImpl implements SupplierService {
    @Resource
    private SupplierDao supplierDao;
    @Override
    public List<Supplier> selectSupplierAll() {
        return supplierDao.selectList(null);
    }

    @Override
    public Set<Supplier> queryDeptTreeList() {
        return supplierDao.queryDeptTreeList();
    }

    @Override
    public Set<Supplier> selectDeptChildrenById(String supplierid) {
        return supplierDao.selectDeptChildrenById(supplierid);
    }

    @Override
    public Set<Supplier> queryDeptTreeLists() {
        return supplierDao.queryDeptTreeLists();
    }

    @Override
    public String selectNameById(String sid) {
        return supplierDao.selectNameById(sid);}
    public IPage<Supplier> selectPage(IPage<Supplier> page, Wrapper<Supplier> queryMapper) {
        return supplierDao.selectPage(page, queryMapper);
    }

    @Override
    public int delecteSupplier(String supplierid) {
        return supplierDao.delecteSupplier(supplierid);
    }

    @Override
    public int insertSupplier(String sname, String saccount, String sphone) {
        return supplierDao.insertSupplier(sname, saccount, sphone);
    }

    @Override
    public int updateSupplier(String supplierid, String sname, String saccount, String sphone) {
        return supplierDao.updateSupplier(supplierid, sname, saccount, sphone);
    }
}
